<!DOCTYPE html>
<html lang="en">
<head>
    <title>佳怡供应链金融</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

    <meta name="description" content="Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.
">
    <link rel="stylesheet" href="lib/weui.min.css">
    <link rel="stylesheet" href="css/jquery-weui.css">
    <link rel="stylesheet" href="demos/css/demos.css">
    <link rel="stylesheet" href="font/fontscss/iconfont.css">
    <link rel="stylesheet" href="css/common.css">

    <style type="text/css">
        .weui-cells {
            /*margin-bottom: 15%;*/
        }

        .weui-cells_checkbox .weui-cell__hd {
            width: 8%;
            float: left;
        }

        .weui_cells .weui-row {
            background: #fff;
        }

        .itemtop {
            font-size: 16px;
            margin-bottom: 0.5rem;
            margin-top: 0.5rem;
        }

        .itemtop span {
            border-left: 6px solid #FF9461;
            padding-left: 1rem;
            margin-top: 0.2rem;
            margin-left: 1rem;
        }

        span {
            width: 24%;
            display: inline-block;
            margin-left: 1rem;
        }

        .itembommon {
            line-height: 1.0rem;
        }

        .itembommon .content {
            color: #FF9461;
            font-size: 14px;
        }

        .itembommon .content-title {
            color: #A2A2A2;
            font-size: 14px;
        }

        #project {
            margin-top: 0.3rem;
        }

        .input_left span {
            position: absolute;
            line-height: 30px;
            left: 10px;
            top: 8px;
            font-size: 18px;
            color: #333;
        }

        .input_left .weui-col-50 input {
            color: #333;
            width: 100%;
            padding-left: 35px;
            height: 45px;
            border: none;
            box-sizing: border-box;
            line-height: 35px;
            font-size: 18px;
            border-right: 1px solid #dcdcdc;
        }

        .input_right input {
            border-radius: 4px;
            height: 45px;
            line-height: 45px;
            box-sizing: border-box;
        }

        .content-padded .weui_article section {
            margin-bottom: 0;
            width: 100%;
        }

        .approve_list li {
            border-bottom: 1px solid #e6e6e6;
            padding: 10px 15px;
            font-size: 16px;
        }

        .icon_back {
            position: absolute;
            left: -1rem;
            top: 0.9rem;
            width: 0.5rem;
            height: 1.0rem;
            background: url(./images/icon-back.png);
            background-size: 0.5rem 1em;
            vertical-align: middle;
        }

        p {
            font-family: PingFangSC-Regular;
            color: #FFFFFF;
            letter-spacing: 0;
        }

        ul {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        ul li p {
            color: #111111;
        }

        #project li {
            height: 4rem;
            position: relative;
            border-bottom: 1px solid #ececec;
        }

        .open-popup:after {
            content: " ";
            display: inline-block;
            height: 6px;
            width: 6px;
            border-width: 2px 2px 0 0;
            border-color: #c8c8cd;
            border-style: solid;
            -webkit-transform: matrix(.71, .71, -.71, .71, 0, 0);
            transform: matrix(.71, .71, -.71, .71, 0, 0);
            position: relative;
            top: -2px;
            position: absolute;
            top: 50%;
            right: 15px;
            margin-top: -4px;
        }

        .open-popup:active {
            background-color: #ececec;
        }
    </style>
    <script src="lib/jquery-2.1.4.js"></script>

</head>

<body>
<header>
    <div class="weui-row weui-no-gutter">
        <div class="weui-col-33" id="back_icon">
            <a href="javascript:history.go(-1)" class="icon pull-right"><i class="icon_back"></i></a>
        </div>
        <div class="weui-col-33">投资记录</div>
        <div class="weui-col-33">
        </div>
    </div>
</header>
<div class="weui-cells">

    <div style="background: #FFFFFF;">
        <ul id="project">
        </ul>

    </div>
</div>
</body>
<script src="js/circleProgress.js"></script>
<script src="js/jquery-weui.js"></script>
<script src="js/dropload.js"></script>
<link rel="stylesheet" href="js/dropload.css">
<script src="js/reg.js"></script>
<script type="text/javascript">
    $("#project").on("click", "li", function () {
        window.location.href = "tzRecordInfo.html";
        localStorage.setItem("id", $(this).attr("data-id"));
    });
    var page = 0;
    // 每页展示6个
    var size = 6;
    function loadProDataTop(me) {
        $.ajax({
            type: "POST",
            url: "productRelease/getInvestRecorde",
            data: {state: page * 1, size: size, token: localStorage.getItem("token")},
            success: function (msg) {
                if (msg != "" && msg != null) {
                    page = page + 6;
                    var str = "";
                    $.each(msg, function (x, y) {
                        str += "<li class=\"open-popup\" data-id=\""+y.id+"\">"
                        str += "    <div class=\"itemtop\">"
                        str += "    <span>" + y.product_id + "</span>"
                        str += "    </div>"
                        str += "    <div class=\"itembommon\">"
                        str += "   <div class=\"content-title\">"
                        str += "    <span class=\"leftborder\">会员姓名</span>"
                        str += "    <span class=\"leftborder\">投资金额 </span>"
                        str += "    <span class=\"leftborder\">现收益率</span>"
                        //  str += "   <span>是否确认</span>"
                        str += "    </div>"
                        str += "   <div class=\"content\">"
                        str += "   <span class=\"leftborder\">" + y.username + "</span>"
                        str += "   <span class=\"leftborder\">" + y.withdraw_money + "%</span>"
                        str += "   <span class=\"leftborder\">" + y.qrsyl + "</span>"
                        //   str += "    <span>" + (y.investment_status == 1 ? "已确认" : "未确认") + "</span>"
                        str += "     </div>"
                        str += "    </div>"
                        str += "   </li>"
                    })

                }
                // 为了测试，延迟1秒加载
                setTimeout(function () {

                    $("#project").html(str);
                    // 每次数据加载完，必须重置
                    me.resetload();
                    // 重置页数，重新获取loadDownFn的数据
                    /*page = 0;*/
                    // 解锁loadDownFn里锁定的情况
                    me.unlock();
                    me.noData(false);
                }, 1000);
            }, error: function (xhr, type) {
                alert('Ajax error!');
                // 即使加载出错，也得重置
                me.resetload();
            }
        });
    }
    function loadProDataDow(me) {
        var str = "";
        $.ajax({
            type: "POST",
            url: "productRelease/getInvestRecorde",
            data: {state: page * 1, size: size, token: localStorage.getItem("token")},
            success: function (msg) {
                console.info(msg);
                if (msg != "" && msg != null) {
                    page = page + 6;
                    $.each(msg, function (x, y) {
                        str += "<li class=\"open-popup\" data-id=\""+y.id+"\">"
                        str += "    <div class=\"itemtop\">"
                        str += "    <span>" + y.product_id + "</span>"
                        str += "    </div>"
                        str += "    <div class=\"itembommon\">"
                        str += "   <div class=\"content-title\">"
                        str += "    <span class=\"leftborder\">会员姓名</span>"
                        str += "    <span class=\"leftborder\">投资金额 </span>"
                        str += "    <span class=\"leftborder\">现收益率</span>"
                        //  str += "   <span>是否确认</span>"
                        str += "    </div>"
                        str += "   <div class=\"content\">"
                        str += "   <span class=\"leftborder\">" + y.username + "</span>"
                        str += "   <span class=\"leftborder\">" + y.withdraw_money + "</span>"
                        str += "   <span class=\"leftborder\">" + y.qrsyl + "%</span>"
                        //   str += "    <span>" + (y.investment_status == 1 ? "已确认" : "未确认") + "</span>"
                        str += "     </div>"
                        str += "    </div>"
                        str += "   </li>"
                    })
                } else {
                    // 锁定
                    me.lock();
                    // 无数据
                    me.noData();
                }
                // 为了测试，延迟1秒加载
                setTimeout(function () {
                    // 插入数据到页面，放到最后面
                    $("#project").append(str);
                    // 每次数据插入，必须重置
                    me.resetload();
                }, 1000);
            }, error: function (xhr, type) {
                alert('Ajax error!');
                // 即使加载出错，也得重置
                me.resetload();
            }
        });
    }

    $(function () {
        $('.weui-cells').dropload({
            scrollArea: window,
            domUp: {
                domClass: 'dropload-up',
                domRefresh: '<div class="dropload-refresh">↓下拉刷新</div>',
                domUpdate: '<div class="dropload-update">↑释放更新</div>',
                domLoad: '<div class="dropload-load"><span class="loading"></span>加载中</div>'
            },
            domDown: {
                domClass: 'dropload-down',
                domRefresh: '<div class="dropload-refresh">↑上拉加载更多</div>',
                domLoad: '<div class="dropload-load"><span class="loading"></span>加载中</div>',
                domNoData: '<div class="dropload-noData">暂无数据</div>'
            },
            loadUpFn: function (me) {
                page = 0;
                loadProDataTop(me);
            },
            loadDownFn: function (me) {
                loadProDataDow(me);
            },
            threshold: 50
        });
    });
</script>
<script src="js/web/checkLogin.js"></script>
</html>